package com.tutorial.demo.threadDemo;

import java.util.concurrent.locks.LockSupport;

public class ThreadPark {
    public static void main(String[] args) {
        Runnable r1 = ()->{
            for (int i = 0; i < 10000; i++) {
                System.out.print(i + " ,");
            }
            System.out.println();
            System.out.println(Thread.currentThread().getName()+" is running");
        };
        Thread t1 = new Thread(r1);
        t1.setName("Thread1");
        t1.start();
//        LockSupport.unpark(t1);
        //到底是把哪个线程挂起了
        LockSupport.park(t1);
    }
}
